using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "EnemyAttackMostTarget-最高攻击力的敌方", menuName = "Skill/Target/EnemyAttackMostTarget-最高攻击力的敌方")]
public class EnemyAttackMostTarget : TargetSelectorBase
{
    public override List<Chess> SelectTargets(Chess chess, GameEvent e)
    {
        var list = new List<Chess>();
        var chessList = ChessManager.GetInstance().chessList;
        foreach (var c in chessList)
        {
            if (c.GetChessSide() == chess.GetChessSide()) continue;
            if (list.Count == 0)
            {
                list.Add(c);
            }
            else
            {
                if (list[0].GetComponent<Chess>().ChessDetail.Attack < c.ChessDetail.Attack)
                {
                    list[0] = c;
                }
            }

        }
        
        return list;
    }
}